/* 
* @Author: anchen
* @Date:   2018-12-31 10:08:15
* @Last Modified by:   anchen
* @Last Modified time: 2018-12-31 15:27:09
*/
$(function () {

});

function searchData() {


    var table = layui.table, layer = layui.layer;

    table.init('serviceTable',{
        data: [

            {
                id: 1,
                "DTBHLX":"a类",
                "DYLX":"养老待遇",
                "JZXMLX":"n项目",
                "JTGX":"双亲"
            }
        ]
        , toolbar: true
        , title: '农村低保对象信息'
        , page: true
    });

    //监听行工具事件
    table.on('tool(serviceTable)', function (obj) { //注：tool 是工具条事件名，test 是 table 原始容器的属性 lay-filter="对应的值"
        var data = obj.data //获得当前行数据
            , layEvent = obj.event; //获得 lay-event 对应的值

        if (layEvent === 'detail') {
            loadDetail(data.id)
        }
    });
}

function loadDetail(id) {
    var data = [
           {
            "DTBHLX":"a类",
            "DYLX":"养老待遇",
            "JZXMLX":"n项目",
            "JTGX":"双亲",
            "JZYWLX":"A类型",
            "HJXZ":"农村",
            "RYZT":"无",
            "ZBBZ":"无",
            "JYZK":"无",
            "XYZK":"离校",
            "WHCD":"本科",
            "JKZK":"良好",
            "CJDJ":"一级",
            "CJLB":"无",
            "ZZMM":"清白",
            "MZ":"汉族",
            "XB":"男",
            "ZYZPYY":"穷",
            "DXZJ":"无",
            "SQXZQHDM":"1234545",
            "GXSJ":"2018-06-06",
            "CSRQ":"1994-08-08",
            "JZNY":"2017-08-10",
            "JZDZ":"广州韶关",
            "HJFZ":"广中韶关",
            "HJDZ":"广中韶关",
            "XM":"李文华",
            "CYSFZHM":"350233199808040098",
            "HZSFZHM":"350233199808040092",
            "JRSR":"80",
            "JZJE":"90",
            "DTBHJE":"10",
            "NDNL": "无",
            "LXFS": "18912345678",
            "CYSR": "78"
        }
    ];


    var data0 = data[parseInt(id) - 1];

    $('#detailD').html(template('detailDS',{data:data0}))
    layer.open({
        type: 1,
        content: $("#detail"),
        area: ['900px', '550px'],
        title: '农村低保对象信息',
        maxmin: true,
        shade: 0,
        cancel: function () {
            $("#detail").hide()
        }
    });


}